<template>
  <div class="list-container">
    <div class="sortList clearfix">
      <div class="center">
        <!--banner轮播-->
        <Carousel :list="bannerList"/>
      </div>
      <div class="right">
        <div class="news">
          <h4>
            <em class="fl">网上竞拍快报</em>
            <span class="fr tip">更多 ></span>
          </h4>
          <div class="clearix"></div>
          <ul class="news-list unstyled">
            <li><span class="bold">[特惠]</span>备战疫情 所有商品竞拍时间增长</li>
            <li><span class="bold">[公告]</span>备战疫情 所有商品竞拍时间增长</li>
            <li><span class="bold">[特惠]</span>备战疫情 所有商品竞拍时间增长</li>
          </ul>
        </div>
        <ul class="lifeservices">
          <li class="life-item">
            <i class="list-item"></i>
            <router-link to="/process1"><span class="service-intro">参拍流程</span></router-link>
          </li>
          <li class="life-item">
            <i class="list-item"></i>
            <router-link to="/process1"><span class="service-intro">竞拍流程</span></router-link> 
          </li>
          <li class="life-item">
            <i class="list-item"></i>
            <router-link to="/process3"><span class="service-intro">交保证金</span></router-link>
          </li>
          <li class="life-item">
            <i class="list-item"></i>
            <router-link to="/about"><span class="service-intro">常见问题</span></router-link>
          </li>
          <li class="life-item">
            <i class="list-item"></i>
            <a><span class="service-intro">模拟竞拍</span></a>
          </li>
          <li class="life-item">
            <i class="list-item"></i>
            <a><span class="service-intro">支付限额</span></a>
          </li>
          <li class="life-item">
            <i class="list-item"></i>
            <a><span class="service-intro">企业参拍</span></a>
          </li>
          <li class="life-item">
            <i class="list-item"></i>
            <router-link to="/word"><span class="service-intro">查看更多</span></router-link>
          </li>
        </ul>
        <div class="ads">
          <img src="./images/c.jpg" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
import Swiper from 'swiper'
export default {
  name: "ListContainer",
  mounted() {
    //派发action：通过Vuex发起ajax请求
    this.$store.dispatch("getBanner2List");
  },
  computed: {
    ...mapState({
      bannerList: (state) => state.paimai.banner2List,
    }),
  },
};
</script>

<style lang="less" scoped>
.list-container {
  width: 1200px;
  margin: 0 auto;

  .sortList {
    height: 464px;
    padding-left: 210px;

    .center {
      box-sizing: border-box;
      width: 740px;
      height: 100%;
      padding: 5px;
      float: left;
    }

    .right {
      float: left;
      width: 250px;
      background-color: #fff;

      .news {
        border: 1px solid #e4e4e4;
        margin-top: 5px;
        

        h4 {
          border-bottom: 1px solid #e4e4e4;
          padding: 5px 10px;
          margin: 5px 5px 0;
          line-height: 22px;
          overflow: hidden;
          font-size: 14px;

          .fl {
            float: left;
            font-weight: bold;
            font-style:normal
          }

          .fr {
            float: right;
            font-size: 12px;
            font-weight: 400;
          }
        }

        .news-list {
          padding: 5px 15px;
          line-height: 26px;
          font-size: 12px;

          .bold {
            font-weight: 700;
          }
        }
      }

      .lifeservices {
        border-right: 1px solid #e4e4e4;
        overflow: hidden;
        display: flex;
        flex-wrap: wrap;

        .life-item {
          border-left: 1px solid #e4e4e4;
          border-bottom: 1px solid #e4e4e4;
          margin-right: -1px;
          height: 64px;
          text-align: center;
          position: relative;
          cursor: pointer;
          width: 25%;

          a{
            color: #000;
          }

          a:hover{
            color: red;
          }

          .list-item {
            background-image: url(./images/icons.png);
            width: 61px;
            height: 40px;
            display: block;
          }

          .service-intro {
            line-height: 22px;
            width: 60px;
            display: block;
            font-size: 12px;
          }

          &:nth-child(1) {
            .list-item {
              background-image: url("./images/1.png");
              background-repeat: no-repeat;
              background-position: center;
            }
          }

          &:nth-child(2) {
            .list-item {
              background-image: url("./images/2.png");
              background-repeat: no-repeat;
              background-position: center;
            }
          }

          &:nth-child(3) {
            .list-item {
              background-image: url("./images/3.png");
              background-repeat: no-repeat;
              background-position: center;
            }
          }

          &:nth-child(4) {
            .list-item {
              background-image: url("./images/4.png");
              background-repeat: no-repeat;
              background-position: center;
            }
          }

          &:nth-child(5) {
            .list-item {
              background-image: url("./images/5.png");
              background-repeat: no-repeat;
              background-position: center;
            }
          }

          &:nth-child(6) {
            .list-item {
              background-image: url("./images/6.png");
              background-repeat: no-repeat;
              background-position: center;
            }
          }

          &:nth-child(7) {
            .list-item {
              background-image: url("./images/7.png");
              background-repeat: no-repeat;
              background-position: center;
            }
          }

          &:nth-child(8) {
            .list-item {
              background-image: url("./images/8.png");
              background-repeat: no-repeat;
              background-position: center;
            }
          }

          &:nth-child(9) {
            .list-item {
              background-position: 0px -146px;
            }
          }

          &:nth-child(10) {
            .list-item {
              background-position: -62px -146px;
            }
          }

          &:nth-child(11) {
            .list-item {
              background-position: -126px -146px;
            }
          }

          &:nth-child(12) {
            .list-item {
              background-position: -190px -146px;
            }
          }
        }
      }

      .ads {
        margin-top: 5px;

        img {
          opacity: 0.8;
          transition: all 400ms;

          &:hover {
            opacity: 1;
          }
        }
      }
    }
  }
}
</style>